﻿'Public Class WindowsTheme : Implements Theme

'	Public Sub Apply(sender As Object) Implements Theme.Apply
'		If TypeOf sender Is Form Then
'			sender.BackgroundImage = Nothing
'			sender.BackColor = SystemColors.ButtonFace
'			sender.Font = Font
'		ElseIf TypeOf sender Is TreeMenu Then
'			sender.BackColor = SystemColors.ControlDarkDark
'			sender.Font = Font
'		ElseIf TypeOf sender Is TabStrip Then
'			sender.Font = Font
'			sender.BackColor = Color.Transparent
'			sender.BackgroundImage = My.Resources.panelback
'			sender.BackgroundImageLayout = ImageLayout.Tile
'		ElseIf TypeOf sender Is Window Then
'			sender.BackColor = Color.Transparent
'			sender.Font = Font
'		ElseIf TypeOf sender Is ProcessBase Then
'			sender.BackColor = Color.Transparent
'			sender.Font = Font
'			CType(sender, ProcessBase).TopPanel.BackColor = SystemColors.ActiveCaption
'		ElseIf TypeOf sender Is ToolStrip Then
'			CType(sender, ToolStrip).BackColor = SystemColors.ActiveCaption
'		ElseIf TypeOf sender Is Control Then
'			sender.BackColor = Color.Transparent
'			sender.Font = Font
'		End If
'	End Sub

'	Public ReadOnly Property Font As System.Drawing.Font Implements Theme.Font
'		Get
'			Return New Font("segoe ui", 9)
'		End Get
'	End Property

'	Public Sub PaintForm(g As System.Drawing.Graphics, sender As Object) Implements Theme.PaintForm
'		Dim R As Rectangle
'		g.PixelOffsetMode = Drawing2D.PixelOffsetMode.None
'		g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
'		For Each Control As Control In sender.Controls
'			If TypeOf Control Is BaseControl Then
'				If Control.Visible And Not TypeOf Control Is CheckBox Then
'					R = New Rectangle(Control.Left, Control.Top, Control.Width, Control.Height)
'					System.Windows.Forms.ControlPaint.DrawBorder(g, R, SystemColors.ButtonShadow, ButtonBorderStyle.Solid)
'					R.Inflate(-1, -1)
'					System.Windows.Forms.ControlPaint.DrawBorder(g, R, Color.White, ButtonBorderStyle.Solid)
'				End If
'			ElseIf TypeOf Control Is Label And Not TypeOf sender Is HtmlLayout Then
'				Control.Visible = False
'				If Control.Enabled Then
'					Dim F As New StringFormat
'					g.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
'					F.Alignment = StringAlignment.Near
'					Dim Label As Label = Control
'					Dim Tw As Integer = g.MeasureString(Label.Text, Label.Font).Width + 0.5
'					R = Label.Bounds
'					Select Case Label.TextAlign
'						Case ContentAlignment.TopLeft, ContentAlignment.MiddleLeft, ContentAlignment.BottomLeft : R = New Rectangle(R.Left, R.Top, Tw, R.Height) : F.Alignment = StringAlignment.Near
'						Case ContentAlignment.TopCenter, ContentAlignment.MiddleCenter, ContentAlignment.BottomCenter : R.Offset((R.Width - Tw) / 2, 0)
'						Case ContentAlignment.TopRight, ContentAlignment.MiddleRight, ContentAlignment.BottomRight : R = New Rectangle(R.Right - Tw * 2, R.Top, Tw * 2, R.Height) : F.Alignment = StringAlignment.Far
'					End Select
'					F.LineAlignment = StringAlignment.Center
'					DrawText(g, Label.Text, Label.Font, SystemColors.WindowText, R, F)
'				End If
'			ElseIf TypeOf Control Is Label Then
'				Control.ForeColor = SystemColors.WindowText
'			End If
'		Next
'	End Sub

'	Public Sub PaintListHeader(g As System.Drawing.Graphics, R As System.Drawing.Rectangle) Implements Theme.PaintListHeader
'		g.SmoothingMode = Drawing2D.SmoothingMode.None
'		g.FillRectangle(New SolidBrush(SystemColors.ButtonFace), R)
'		g.DrawLine(New Pen(Color.FromArgb(32, Color.Black)), R.Right - 1, R.Top + 3, R.Right - 1, R.Bottom - 4)
'		g.DrawLine(New Pen(Color.FromArgb(16, Color.Black)), R.Left, R.Bottom - 1, R.Right - 1, R.Bottom - 1)
'	End Sub

'	Public Sub PaintListColumnHeader(g As System.Drawing.Graphics, R As System.Drawing.Rectangle, Col As System.Windows.Forms.DataGridViewColumn) Implements Theme.PaintListColumnHeader
'		PaintListHeader(g, R)
'		g.SmoothingMode = Drawing2D.SmoothingMode.None
'		If Col.Tag = "s" Then
'			R.Inflate(-1, -1)
'			R.Width -= 1 : R.Height -= 1
'			g.FillRectangle(New SolidBrush(Color.FromArgb(48, Color.White)), R)
'			R.Width -= 1 : R.Height -= 1
'			g.DrawRectangle(New Pen(Color.FromArgb(64, Color.Black)), R)
'			R.Width += 2 : R.Height += 2
'			R.Inflate(1, 1)
'		End If
'		Dim SF As New StringFormat
'		SF.LineAlignment = StringAlignment.Center
'		Select Case Col.DefaultCellStyle.Alignment
'			Case DataGridViewContentAlignment.MiddleLeft : SF.Alignment = StringAlignment.Near
'			Case DataGridViewContentAlignment.MiddleCenter : SF.Alignment = StringAlignment.Center
'			Case DataGridViewContentAlignment.MiddleRight : SF.Alignment = StringAlignment.Far
'		End Select
'		R.Inflate(-2, -2)
'		g.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
'		DrawStringLighted(g, Col.HeaderText, Font, Color.Black, R, SF)
'	End Sub

'	Public ReadOnly Property FormColor As System.Drawing.Color Implements Theme.FormColor
'		Get
'			Return SystemColors.ButtonFace
'		End Get
'	End Property

'	Public ReadOnly Property ReadOnlyColor As System.Drawing.Color Implements Theme.ReadOnlyColor
'		Get
'			Return SystemColors.ButtonFace
'		End Get
'	End Property

'	Public Sub SetBackground(P As Object, Type As Integer) Implements Theme.SetBackground
'		P.BackgroundImage = Nothing
'	End Sub

'	Public Sub Blur(G As System.Drawing.Graphics, Form As System.Windows.Forms.Form, Control As System.Windows.Forms.Control, Rect As System.Drawing.Rectangle) Implements Theme.Blur

'	End Sub

'	Public Sub PaintListRowHeader(graphics As System.Drawing.Graphics, R As System.Drawing.Rectangle, Row As System.Windows.Forms.DataGridViewRow) Implements Theme.PaintListRowHeader

'	End Sub

'	Public ReadOnly Property LabelColor As System.Drawing.Color Implements Theme.LabelColor
'		Get

'		End Get
'	End Property
'End Class
